#pragma once

#include "cocos2d.h"
//#include"cocos-ext.h"
#include <QMouseEvent>
#include <QWidget>

class QCGLWidget;
//USING_NS_CC_EXT;
USING_NS_CC;

class QCGLView : public GLViewImpl/*,public ScrollViewDelegate*/
{
public:
    QCGLView();
    virtual ~QCGLView();

	virtual bool isOpenGLReady() override;
	virtual void end() override;
	virtual void swapBuffers() override;
	virtual void setFrameSize(float width, float height) override;
	virtual void setIMEKeyboardState(bool bOpen) override;
    virtual void setViewName(const char* pszViewName);
//private:
//	virtual void scrollViewDidScroll(ScrollView* view)override;
//	virtual void scrollViewDidZoom(ScrollView* view)override;
//	//virtual void scrollViewMoveOver(ScrollView* view)override;
public:
	void setBgColor(const Color4B &color);
	HWND getWin32Window()
	{
		return m_hWnd;
	}
	static QCGLView* getInstance();

	/*virtual*/ void init(HWND hwnd);

private:
	HWND			m_hWnd;
    float			_screenScaleFactor;
	float			_lastWindowHeight;
	Color4F			_bgColor;
};


